(provide 'dired-cfg)

;; dired进入文件夹时，复用当前buffer
(put 'dired-find-alternate-file 'disabled nil)
(with-eval-after-load 'dired
  (define-key dired-mode-map (kbd "RET") 'dired-find-alternate-file)
  (require 'dired-x)  ;; for use C-x C-j to jump to current dir
  )


(setq my-dired-switch 1)

;; 设置dird界面，对ls的结果过滤以及整齐的日期格式
(setq my-dired-ls-switches "-alh --ignore=.* --ignore=\\#* --ignore=*~ --time-style long-iso")
(add-hook 'dired-mode-hook
          (lambda ()
            "Set the right mode for new dired buffers."
            (when (= my-dired-switch 1)
              (dired-sort-other my-dired-ls-switches))))
